/*
 * etco2.h
 *
 *  Created on: 11-08-2012
 *      Author: Acer
 */

#ifndef ETCO2_H_
#define ETCO2_H_

#include "../UART/UART.h"
#ifdef __USE_CMSIS
#include "LPC17xx.h"
#endif
#include "FreeRTOS.h"
#include "queue.h"
#include "semphr.h"
#include "portmacro.h"
#include "semphr.h"
#include "timers.h"

#define RECEIVER_DATA_READY (0x1)

typedef struct
{
	uint8_t rx[255];
	uint8_t head;
	uint8_t tail;
} UART_RX_Circular_Buffer;

void SetupETCO2Module();
void UART2_Config(int Baudrate);
__INLINE void  UART2_PrintChar (uint8_t ch);
__INLINE void UART2_PrintStr (uint8_t * str);
uint8_t UART2_Getchar(void);
uint8_t IsResponseReceived(uint8_t *str);
uint8_t IsFrameWReceived();
float GetCO2Concentration();
__INLINE void UART2_RxFIFO_Reset(void);
#endif /* ETCO2_H_ */
